
# from models import FAVAE
# from torch.utils.data import DataLoader
# from datasets import mvtec
# from torchvision import transforms
# from utils.schedulers import *
# from models.cutpaste import CutPasteNormal,CutPasteScar, CutPaste3Way, CutPasteUnion, cut_paste_collate_fn

# def cutpaste_run(cfg,phase='train',weights=''):
#     print('using cutpaste')
#     category = cfg['normal_class']
#     train_batch_size = cfg['train_batch_size']
#     test_batch_size = cfg['test_batch_size']
#     load_size = cfg['load_size']
#     input_size = cfg['input_size']
#     epochs = cfg['epochs']
#     test_interval = cfg['test_interval']

#     if category == 'all':
#         train_class = mvtec.CLASS_NAMES
#     else:
#         train_class = [category]


#     for c in train_class:
#         train_transform = transforms.Compose([])
#         #train_transform.transforms.append(transforms.RandomResizedCrop(size, scale=(min_scale,1)))
#         train_transform.transforms.append(transforms.ColorJitter(brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1))
#         # train_transform.transforms.append(transforms.GaussianBlur(int(size/10), sigma=(0.1,2.0)))
#         train_transform.transforms.append(transforms.Resize((input_size,input_size)))
#         train_transform.transforms.append(CutPasteNormal())
#         train_data = mvtec.MVTecDataset(
#             root_path=cfg['dataset_dir'], class_name=c, is_train=True, resize=load_size, cropsize=input_size, transform = train_transform)
        



#         train_dataset = mvtec.MVTecDataset(
#             root_path=cfg['dataset_dir'], class_name=c, is_train=True, resize=load_size, cropsize=input_size)

#         train_dataloader = DataLoader(
#             train_dataset, batch_size=train_batch_size, pin_memory=True, num_workers=0)
#         test_dataset = mvtec.MVTecDataset(
#             root_path=cfg['dataset_dir'], class_name=c, is_train=False, resize=load_size, cropsize=input_size)
#         test_dataloader = DataLoader(
#             test_dataset, batch_size=test_batch_size, pin_memory=True, num_workers=0)

#         if phase == 'train':
#             for epoch in range(epochs):
#                 model.train(epoch, train_dataloader ,c)
#                 if epoch % test_interval == 0:
#                     model.test(c, test_dataloader)
#                     model.evaluate(c)
#                     model.init_results_list()
#         elif phase == 'test':
#             model.test(c, test_dataloader , weight_path = weights)
#             model.evaluate(c)
#             model.init_results_list()

